import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useUserStore = defineStore(
	'user',
	() => {
		const token = ref('')
		const redirectURL = ref('/pages/index/index')
		const openType = ref('switchTab')
		const userId = ref('')
		return {
			token,
			redirectURL,
			openType,
			userId,
		}
	},
	{
		persist: {
			paths: ['token', 'redirectURL', 'openType', 'userId'],
		},
	}
)
